package hottargui.view;

import minidraw.framework.*;

/** Status text 

    Responsibility: Tell the players what to do

    Author: Allan
 */

public class StatusMessenger implements Messenger{
	/** The Drawing this messenger is associated with. */
	Drawing model;
	/** The view this messenger is associated with */
	DrawingView view;

	/** the message figure used to display text */
	MessageFigure         mfig;

	public StatusMessenger(Drawing model) {
		this.model = model;
		mfig = new MessageFigure();
		mfig.setText("Messenger");
		mfig.moveBy(700,250);
	}

	public void setText(String text) {
		removeText();
		mfig.setText(text);
		model.lock();
		model.add(mfig);
		model.unlock();
		model.requestUpdate();
	}

	public void removeText() {
		model.lock();
		model.remove(mfig);
		model.unlock();
		model.requestUpdate();
	}
}

